<template>
	<div>
		<div>
			<a style="margin-top: 10px;" class="btn btn-primary" type="button" href="/Admin/AddBook">添加图书</a>
		</div>
		<div>
			<a style="margin-top: 10px;" class="btn btn-primary" type="button" href="/Admin/AddBookClass">添加图书分类</a>
		</div>
		<div>
			<a style="margin-top: 10px;" class="btn btn-primary" type="button" href="/Admin/AdminSearch">修改图书</a>
		</div>
		<div>
			<a style="margin-top: 10px;" class="btn btn-primary" type="button" href="/Admin/History">查看借阅历史</a>
		</div>
	</div>
</template>

<script>
	import {
		computed,
		reactive,
		toRefs,
		onMounted,
	} from "vue";
	import {
		useRouter,
		useRoute
	} from "vue-router";
	import {
		useStore,
	} from "vuex";
	import axios from "axios";

	export default {
		props: {
			//入口参数
		},
		components: {
			//引入组件
		},
		setup() {
			//实例化userouter
			const router = useRouter();
			const store = useStore();
			store.state.ifFrameShow = false;
			//onMounted()生命周期
			onMounted(() => {
				axios
					.get("Admin")
					.then((response) => (data.bookL1 = response.data.data))
					.catch((error) => {
						console.log(error)
						if (error.status === 403) {
							alert("权限不足")
							router.push({
								name: 'Main'
							})
						}

					});
			});
			const data = reactive({
				
			});
			return {
				...toRefs(data),
			};
		},
	};
</script>


<style>

</style>
